﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!-- #region Styles -->

    <Style x:Name="CoolButtonTemplate" TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontSize" Value="10"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="Padding" Value="10,2"/>
        <Setter Property="BorderBrush" Value="Black"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" >
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                    <GradientStop Color="#22ffffff" Offset="0.2"/>
                    <GradientStop Color="#08ffffff" Offset="0.85"/>
                    <GradientStop Color="#30ffffff" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="MouseOverAnimation">
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#fdeeb3" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#fde48d" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#fdf1bc" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#fdfae0" Duration="0:0:0.1" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                        <Storyboard x:Key="MouseOutAnimation" FillBehavior="Stop">
                            <!-- <=================== -->
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#f7fafc" Duration="0:0:0.32" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#f5f8fa" Duration="0:0:0.32" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#edeff2" Duration="0:0:0.32" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#e7eaee" Duration="0:0:0.32" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                        <Storyboard x:Key="MouseUpAnimation" FillBehavior="Stop">
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#fdeeb3" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#fde48d" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#fdf1bc" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#fdfae0" Duration="0:0:0.1" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                        <Storyboard x:Key="MouseDownAnimation">
                            <!-- <=================== -->
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#fbd678" Duration="0:0:0.3" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#FFE48A" Duration="0:0:0.3" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#FFE48A" Duration="0:0:0.3" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#fbd678" Duration="0:0:0.3" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                    </ControlTemplate.Resources>

                    <Border Name="border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientBrush.GradientStops>
                                    <GradientStop x:Name="bgb1" Color="#f7fafc" Offset="0.0" />
                                    <GradientStop x:Name="bgb2" Color="#f5f8fa" Offset="0.25" />
                                    <GradientStop x:Name="bgb3" Color="#edeff2" Offset="0.75" />
                                    <GradientStop x:Name="bgb4" Color="#e7eaee" Offset="1.0" />
                                </GradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </Border.Background>
                        <Border Padding="{TemplateBinding Padding}">
                            <!--<Border.Background>
                                    <RadialGradientBrush RadiusX="1" RadiusY="1" GradientOrigin="0.5,1.2" Center="0.5,1.2" x:Name="brushLight" Opacity="1">
                                        <GradientStop Offset="0.767" Color="#22000000" x:Name="bgs1"/>
                                        <GradientStop Offset="0.86" Color="#08ff0000" x:Name="bgs2"/>
                                        <GradientStop Offset="0.919" Color="#20ffffff" x:Name="bgs3"/>
                                    </RadialGradientBrush>
                                </Border.Background>-->
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Name="content"/>
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOverAnimation}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOutAnimation}" />
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseDownAnimation}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseUpAnimation}" />
                            </Trigger.ExitActions>
                            <Setter TargetName="content" Property="RenderTransform" >
                                <Setter.Value>
                                    <TranslateTransform Y="1.0" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" TargetName="border">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFC29E47" Offset="0"/>
                                        <GradientStop Color="#FFC29E47" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOutAnimation}" />
                            </Trigger.EnterActions>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOutAnimation}" />
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Opacity" Value="0.7" />
                            <Setter Property="Foreground" Value="Gray" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CoolOpenFolderTemplate" TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontSize" Value="10"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="Padding" Value="10,2"/>
        <Setter Property="BorderBrush" Value="Black"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" >
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                    <GradientStop Color="#22ffffff" Offset="0.2"/>
                    <GradientStop Color="#08ffffff" Offset="0.85"/>
                    <GradientStop Color="#30ffffff" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="MouseOverAnimation">
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#fdeeb3" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#fde48d" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#fdf1bc" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#fdfae0" Duration="0:0:0.1" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                        <Storyboard x:Key="MouseOutAnimation" FillBehavior="Stop">
                            <!-- <=================== -->
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#f7fafc" Duration="0:0:0.32" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#f5f8fa" Duration="0:0:0.32" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#edeff2" Duration="0:0:0.32" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#e7eaee" Duration="0:0:0.32" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                        <Storyboard x:Key="MouseUpAnimation" FillBehavior="Stop">
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#fdeeb3" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#fde48d" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#fdf1bc" Duration="0:0:0.1" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#fdfae0" Duration="0:0:0.1" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                        <Storyboard x:Key="MouseDownAnimation">
                            <!-- <=================== -->
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb1" To="#fbd678" Duration="0:0:0.3" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb2" To="#FFE48A" Duration="0:0:0.3" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb3" To="#FFE48A" Duration="0:0:0.3" />
                            <ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="bgb4" To="#fbd678" Duration="0:0:0.3" />
                            <!--<DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb3" To=".19" Duration="0:0:0.3" />
                                <DoubleAnimation Storyboard.TargetProperty="Offset" Storyboard.TargetName="bgb4" To=".81" Duration="0:0:0.3" />-->
                        </Storyboard>
                    </ControlTemplate.Resources>

                    <Border Name="border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientBrush.GradientStops>
                                    <GradientStop x:Name="bgb1" Color="#f7fafc" Offset="0.0" />
                                    <GradientStop x:Name="bgb2" Color="#f5f8fa" Offset="0.25" />
                                    <GradientStop x:Name="bgb3" Color="#edeff2" Offset="0.75" />
                                    <GradientStop x:Name="bgb4" Color="#e7eaee" Offset="1.0" />
                                </GradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </Border.Background>
                        <Grid Name="content">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="auto" />
                            </Grid.ColumnDefinitions>

                            <Border Padding="{TemplateBinding Padding}">
                                <ContentPresenter Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                            <Grid Grid.Column="1" Margin="2 1 5 0" Width="15" Height="15">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="4*" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="1*" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="4*" />
                                </Grid.ColumnDefinitions>
                                <Border Grid.ColumnSpan="3" Grid.Row="1" Margin="0 -.5 0 0" BorderBrush="Black" BorderThickness=".5" CornerRadius="0 1 0 0" Background="#f7f0ab" />
                                <Border BorderBrush="Black" Grid.ColumnSpan="2" BorderThickness=".5 .5 0 0" CornerRadius="1 0 0 0" Background="#f7f0ab" />

                                <Border BorderBrush="Black" Margin="0 0 -1 0" Grid.Column="1" BorderThickness="0 .5 .5 0" CornerRadius="0 .5 0 0" Background="#f7f0ab">
                                    <Border.RenderTransform>
                                        <SkewTransform AngleX="30" />
                                    </Border.RenderTransform>
                                </Border>
                                <Border Grid.ColumnSpan="3" Grid.RowSpan="2" CornerRadius="1 1 0 0" Margin="4 4 -4 0" BorderBrush="Black" BorderThickness=".5">
                                    <Border.Background>
                                        <LinearGradientBrush StartPoint="0 0" EndPoint="1 1">
                                            <GradientStop Color="#ffe084" Offset=".3" />
                                            <GradientStop Color="#fec951" Offset=".5" />
                                            <GradientStop Color="#d48c13" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Border.RenderTransform>
                                        <TransformGroup>
                                            <SkewTransform AngleX="-20" />

                                        </TransformGroup>
                                    </Border.RenderTransform>
                                </Border>
                            </Grid>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOverAnimation}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOutAnimation}" />
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseDownAnimation}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseUpAnimation}" />
                            </Trigger.ExitActions>
                            <Setter TargetName="content" Property="RenderTransform" >
                                <Setter.Value>
                                    <TranslateTransform Y="1.0" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" TargetName="border">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFC29E47" Offset="0"/>
                                        <GradientStop Color="#FFC29E47" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOutAnimation}" />
                            </Trigger.EnterActions>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource MouseOutAnimation}" />
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Opacity" Value="0.7" />
                            <Setter Property="Foreground" Value="Gray" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NoHoverComboBoxStyle" TargetType="{x:Type ComboBox}">
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style>
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Margin="4,4,21,4" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFF3F3F3" Offset="0"/>
                    <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
                    <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                    <GradientStop Color="#FFCDCDCD" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="#FF707070"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Padding" Value="4,3"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
        <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid x:Name="MainGrid" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
                        </Grid.ColumnDefinitions>
                        <Popup x:Name="PART_Popup" AllowsTransparency="True" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
                            <Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}">
                                <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
                                    <ScrollViewer x:Name="DropDownScrollViewer">
                                        <Grid RenderOptions.ClearTypeHint="Enabled">
                                            <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                                <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/>
                                            </Canvas>
                                            <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                        </Grid>
                                    </ScrollViewer>
                                </Border>
                            </Microsoft_Windows_Themes:SystemDropShadowChrome>
                        </Popup>
                        <ToggleButton BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                            <ToggleButton.Style>
                                <Style TargetType="{x:Type ToggleButton}">
                                    <Setter Property="OverridesDefaultStyle" Value="True"/>
                                    <Setter Property="IsTabStop" Value="False"/>
                                    <Setter Property="Focusable" Value="False"/>
                                    <Setter Property="ClickMode" Value="Press"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ToggleButton}">
                                                <Grid Background="Transparent" x:Name="Chrome" SnapsToDevicePixels="True">
                                                    <Grid HorizontalAlignment="Right" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                                                        <Path x:Name="Arrow" Data="M0,0L3.5,4 7,0z" Fill="Black" HorizontalAlignment="Center" Margin="3,1,0,0" VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsEnabled" Value="False">
                                                        <Setter Property="Fill" TargetName="Arrow" Value="#FFAFAFAF"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ToggleButton.Style>
                        </ToggleButton>
                        <ContentPresenter ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="True">
                            <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
                            <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
                        </Trigger>
                        <Trigger Property="HasItems" Value="False">
                            <Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            <Setter Property="Background" Value="#FFF4F4F4"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="True">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                        </Trigger>
                        <Trigger Property="CanContentScroll" SourceName="DropDownScrollViewer" Value="False">
                            <Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                            <Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEditable" Value="True">
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
                            <GradientStop Color="#FFABADB3" Offset="0.05"/>
                            <GradientStop Color="#FFE2E3EA" Offset="0.07"/>
                            <GradientStop Color="#FFE3E9EF" Offset="1"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="Padding" Value="3"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ComboBox}">
                            <Grid x:Name="Placement" SnapsToDevicePixels="True">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Popup x:Name="PART_Popup" AllowsTransparency="True" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
                                    <Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=Placement}">
                                        <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
                                            <ScrollViewer x:Name="DropDownScrollViewer">
                                                <Grid RenderOptions.ClearTypeHint="Enabled">
                                                    <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                                        <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/>
                                                    </Canvas>
                                                    <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                                </Grid>
                                            </ScrollViewer>
                                        </Border>
                                    </Microsoft_Windows_Themes:SystemDropShadowChrome>
                                </Popup>
                                <Microsoft_Windows_Themes:ListBoxChrome x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}"/>
                                <TextBox x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <TextBox.Style>
                                        <Style TargetType="{x:Type TextBox}">
                                            <Setter Property="OverridesDefaultStyle" Value="True"/>
                                            <Setter Property="AllowDrop" Value="True"/>
                                            <Setter Property="MinWidth" Value="0"/>
                                            <Setter Property="MinHeight" Value="0"/>
                                            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                                            <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
                                            <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type TextBox}">
                                                        <ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </TextBox.Style>
                                </TextBox>
                                <ToggleButton Grid.Column="1" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                                    <ToggleButton.Style>
                                        <Style TargetType="{x:Type ToggleButton}">
                                            <Setter Property="OverridesDefaultStyle" Value="True"/>
                                            <Setter Property="IsTabStop" Value="False"/>
                                            <Setter Property="Focusable" Value="False"/>
                                            <Setter Property="ClickMode" Value="Press"/>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                                                        <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RoundCorners="False" SnapsToDevicePixels="True" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                                                            <Path x:Name="Arrow" Data="M0,0L3.5,4 7,0z" Fill="Black" HorizontalAlignment="Center" Margin="0,1,0,0" VerticalAlignment="Center"/>
                                                        </Microsoft_Windows_Themes:ButtonChrome>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="IsChecked" Value="True">
                                                                <Setter Property="RenderPressed" TargetName="Chrome" Value="True"/>
                                                            </Trigger>
                                                            <Trigger Property="IsEnabled" Value="False">
                                                                <Setter Property="Fill" TargetName="Arrow" Value="#FFAFAFAF"/>
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ToggleButton.Style>
                                </ToggleButton>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                                    <Setter Property="Foreground" Value="Black"/>
                                </Trigger>
                                <Trigger Property="IsDropDownOpen" Value="True">
                                    <Setter Property="RenderFocused" TargetName="Border" Value="True"/>
                                </Trigger>
                                <Trigger Property="HasItems" Value="False">
                                    <Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                    <Setter Property="Background" Value="#FFF4F4F4"/>
                                </Trigger>
                                <Trigger Property="IsGrouping" Value="True">
                                    <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                                </Trigger>
                                <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="True">
                                    <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
                                    <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
                                </Trigger>
                                <Trigger Property="CanContentScroll" SourceName="DropDownScrollViewer" Value="False">
                                    <Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                                    <Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="TabPanel">
        <Setter Property="Background" Value="Transparent" />
    </Style>
    <Style TargetType="TabItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <!--<Border x:Name="shaydoo" Opacity="0" Margin="4 4 -8 -8" Background="Black">
                            <Border.Effect>
                                <BlurEffect Radius="20" />
                            </Border.Effect>
                            <Border.OpacityMask>
                                <VisualBrush>
                                    <VisualBrush.Visual>
                                        <Grid Margin="-4 -4 8 8" Height="{Binding ActualHeight, ElementName=shaydoo}" Width="{Binding ActualWidth, ElementName=shaydoo}">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="{Binding ActualHeight, ElementName=hoverborder}" />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <Border Grid.Row="0" Background="Black" />
                                            <Border Grid.Row="1" Background="Transparent" />
                                        </Grid>
                                    </VisualBrush.Visual>
                                </VisualBrush>
                            </Border.OpacityMask>
                        </Border>-->
                        <Border x:Name="hoverborder" BorderThickness="1 1 1 0" CornerRadius="3 3 0 0" Margin="0 0 0 -1">
                            <Border x:Name="bordoor" Padding="0 6 0 0" BorderThickness="1 1 1 0" CornerRadius="3 3 0 0">
                                <TextBlock x:Name="Header" Text="{Binding Path=Header, RelativeSource={RelativeSource TemplatedParent}}" FontFamily="{TemplateBinding FontFamily}"
                                               Foreground="{TemplateBinding Foreground}" Padding="{TemplateBinding Padding}" >
                                    <TextBlock.Effect>
                                        <DropShadowEffect ShadowDepth="2" Opacity=".2" BlurRadius="10" Direction="-90" />
                                    </TextBlock.Effect>
                                </TextBlock>
                            </Border>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background" TargetName="bordoor" >
                                <Setter.Value>
                                    <RadialGradientBrush Center="0 0" RadiusX="20" RadiusY="1">
                                        <GradientStop Color="#ffffff" Offset="0"/>
                                        <GradientStop Color="#ffffff" Offset="1"/>
                                    </RadialGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="#888" TargetName="hoverborder" />
                            <!--<Setter Property="Opacity" Value="0.1" TargetName="shaydoo" />-->
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" TargetName="hoverborder" >
                                <Setter.Value>
                                    <RadialGradientBrush Center="0 0" RadiusX="20" RadiusY="1">
                                        <GradientStop Color="#e4e4e4" Offset="0"/>
                                        <GradientStop Color="#ffffff" Offset="1"/>
                                    </RadialGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="#bbb" TargetName="hoverborder" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{x:Static SystemColors.GrayTextBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="TabControl">
        <Setter Property="Background" >
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#ffffff" Offset=".1"/>
                    <GradientStop Color="#ebeef1" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{x:Type ContextMenu}" TargetType="{x:Type ContextMenu}" BasedOn="{StaticResource {x:Type ContextMenu}}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Border>
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Setter Property="Tag" Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="True">
                                        <Setter Property="Background" Value="Transparent"/>
                                        <Setter Property="Padding" Value="0,0,5,5"/>
                                        <Setter Property="Effect">
                                            <Setter.Value>
                                                <DropShadowEffect BlurRadius="4" Opacity="0.6" ShadowDepth="1"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <Border x:Name="Border" BorderBrush="#CCC" CornerRadius="2" BorderThickness="1" Padding="0,2">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="#FFF" Offset="0" />
                                    <GradientStop Color="#EEE" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}">
        <Setter Property="Foreground" Value="#333" />
        <Setter Property="FontFamily" Value="Calibari" />
        <Setter Property="FontSize" Value="11" />
        <Setter Property="Height" Value="22" />
        <Setter Property="Padding" Value="24,4,48,4" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="MenuItem">
                    <Border x:Name="miBorder" MinWidth="{TemplateBinding MinWidth}" Background="Transparent" BorderThickness="0,1,0,1">
                        <DockPanel HorizontalAlignment="Stretch">
                            <TextBlock x:Name="Header" Text="{Binding Path=Header, RelativeSource={RelativeSource TemplatedParent}}" FontFamily="{TemplateBinding FontFamily}"
                                               Foreground="{TemplateBinding Foreground}" Padding="{TemplateBinding Padding}" />
                            <TextBlock x:Name="InputGestureText" FontSize="10" Text="{TemplateBinding InputGestureText}"
                                               Margin="5,2,2,2" Padding="0,3,16,3" DockPanel.Dock="Right" />
                            <Popup x:Name="SubMenuPopup" Placement="Bottom" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Focusable="false">
                                <Border>
                                    <ItemsPresenter Margin="1" KeyboardNavigation.DirectionalNavigation="Cycle" />
                                </Border>
                            </Popup>
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="MenuItem.IsHighlighted" Value="True">
                            <Setter Property="Background" Value="{x:Static SystemColors.HighlightBrush}" TargetName="miBorder" />
                            <Setter Property="BorderBrush" Value="#CCC" TargetName="miBorder" />
                            <Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
                            <Setter Property="Effect" TargetName="Header">
                                <Setter.Value>
                                    <DropShadowEffect BlurRadius="5" ShadowDepth="0" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Effect" TargetName="InputGestureText">
                                <Setter.Value>
                                    <DropShadowEffect BlurRadius="5" ShadowDepth="0" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="MenuItem.IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{x:Static SystemColors.GrayTextBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}" BasedOn="{StaticResource {x:Type Separator}}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Separator}">
                    <Border BorderBrush="#CCC" BorderThickness="0,1,0,0" Margin="20,1,28,1" Padding="1,0,0,0">
                        <Rectangle Height="1" Fill="#FFF" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ContextMenu x:Key="StandardContextMenu">
        <MenuItem Header="Cut" Command="ApplicationCommands.Cut"/>
        <MenuItem Header="Copy" Command="ApplicationCommands.Copy"/>
        <MenuItem Header="Paste" Command="ApplicationCommands.Paste"/>
    </ContextMenu>

    <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="ContextMenu" Value="{StaticResource StandardContextMenu}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border Name="Border" CornerRadius="2" Padding="2" Background="#FFF" BorderBrush="#CCC" BorderThickness="1">
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="#EEE"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="#EEE"/>
                            <Setter Property="Foreground" Value="#888" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type PasswordBox}" TargetType="{x:Type PasswordBox}" BasedOn="{StaticResource {x:Type PasswordBox}}">
        <Setter Property="ContextMenu" Value="{StaticResource StandardContextMenu}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Border Name="Border" CornerRadius="2" Padding="2" Background="#FFF" BorderBrush="#CCC" BorderThickness="1">
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="#EEE"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="#EEE"/>
                            <Setter Property="Foreground" Value="#888" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- #endregion Styles -->
</ResourceDictionary>